#include "MyReactor.h"

MyReactor * MyReactor::instance_ = 0;

void MyReactor::registerHandler(EventHandler * eh, EventType et)
{
  reactor_->registerHandler( eh, et );
}

void MyReactor::removeHandler(EventHandler * eh, EventType et)
{
  reactor_->removeHandler( eh, et );
}

void MyReactor::handleEvents(timeval * timeout)
{
  reactor_->handleEvents(timeout);
}

MyReactor * MyReactor::instance()
{
  if ( instance_ == 0 )
    {
      instance_ = new MyReactor();
    }

  return instance_;
}

MyReactor::MyReactor()
  : reactor_(new SelectorReactor)
{}


